@echo off
echo 正在检查Python安装...

where python >nul 2>nul
if %errorlevel% neq 0 (
    echo Python未安装，正在下载Python安装程序...
    powershell -Command "& {Invoke-WebRequest -Uri 'https://www.python.org/ftp/python/3.8.10/python-3.8.10-amd64.exe' -OutFile 'python_installer.exe'}"
    
    echo 正在安装Python...
    python_installer.exe /quiet InstallAllUsers=1 PrependPath=1
    
    echo 等待Python安装完成...
    timeout /t 30 /nobreak
    
    echo 清理安装文件...
    del python_installer.exe
) else (
    echo Python已安装
)

echo 检查jxlang是否已安装...
python -c "import jxlang" >nul 2>nul
if %errorlevel% neq 0 (
    echo jxlang未安装，正在安装...
    pip install jxlang -i https://pypi.tuna.tsinghua.edu.cn/simple
) else (
    echo jxlang已安装,下次启动时请在终端输入jxlang即可启动
)
pause 